<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="企业名称" prop="companyName">
        <el-input
          style="width: 150px;"
          v-model="queryParams.companyName"
          placeholder="请输入企业名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户分类" prop="classification">
        <el-select v-model="queryParams.classification" placeholder="请选择客户分类" style="width: 150px;">
          <el-option label="--请选择--" value="" @keyup="handleQuery"></el-option>
          <el-option label="普通客户" value="普通客户" @keyup="handleQuery"></el-option>
          <el-option label="重要客户" value="重要客户" @keyup="handleQuery"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="客户属性" prop="property">
        <el-select v-model="queryParams.property" placeholder="请选择客户属性" style="width: 150px;">
          <el-option label="--请选择--" value="" @keyup="handleQuery"></el-option>
          <el-option label="新客户" value="新客户" @keyup="handleQuery"></el-option>
          <el-option label="老客户" value="老客户" @keyup="handleQuery"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="签约状态" prop="contract">
        <el-select v-model="queryParams.contract" placeholder="请选择客户属性" style="width: 150px;">
          <el-option label="--请选择--" value="" @keyup="handleQuery"></el-option>
          <el-option label="已签约" value="已签约" @keyup="handleQuery"></el-option>
          <el-option label="未签约" value="未签约" @keyup="handleQuery"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="" prop="all" style="width: 150px;">
        <el-input
          v-model="queryParams.all"
          placeholder="请输入搜索内容"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:enterprise:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:enterprise:edit']"
        >修改
        </el-button>
      </el-col>

      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <!--  客户列表  -->
    <el-table v-loading="loading" :data="enterpriseList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <!--      <el-table-column label="企业id" align="center" prop="companyId"/>-->
      <el-table-column label="企业名称" :show-overflow-tooltip="true" align="center" prop="companyName" width="180"/>
      <el-table-column label="客户分类" align="center" prop="classification" width="100"/>
      <el-table-column label="客户属性" align="center" prop="property" width="100"/>
      <el-table-column label="省市区" align="center" prop="province" width="230"/>
      <el-table-column label="详细地址" :show-overflow-tooltip="true" align="center" prop="address" width="140"/>
      <el-table-column label="公司规模" align="center" prop="scale" width="100"/>
      <el-table-column label="联系人" align="center" prop="linkman" width="100"/>
      <el-table-column label="职务" align="center" prop="post" width="100"/>
      <el-table-column label="联系电话" align="center" prop="phone" width="120"/>
      <el-table-column label="是否签约" align="center" prop="contract" width="100"/>
     <!-- <el-table-column label="在招岗位" align="center" prop="attract" width="100">
        <template slot-scope="scope">
          <div v-if="scope.row.attract == null">
            0
          </div>
          <div v-if="scope.row.attract != null">
            {{ scope.row.attract }}
          </div>
        </template>
      </el-table-column>-->
     <!-- <el-table-column label="入职人员" align="center" prop="entry" width="100">
        <template slot-scope="scope">
          <div v-if="scope.row.entry == null">
            0
          </div>
          <div v-if="scope.row.entry != null">
            {{ scope.row.entry }}
          </div>
        </template>
      </el-table-column>-->
      <el-table-column label="保护状态" align="center" prop="protectStatus" width="100">
        <template slot-scope="scope">
          <div v-if="scope.row.protectStatus == '0'">
            保护中
          </div>
          <div v-if="scope.row.protectStatus == '1'">
            无保护
          </div>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="130">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="负责人" align="center" prop="entry" width="100">
        <template slot-scope="scope">
          <center>{{ scope.row.createName }}</center>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="240">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-s-management"
            @click="getEnte(scope.row.companyId)"
            v-hasPermi="['system:enterprise:query']"
          >企业信息
          </el-button>



        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <el-dialog :before-close="resetProject" title="查看项目组" :visible.sync="projectTeamVisible" center>
      <el-button type="primary" @click="projectTeamFormDialog()">添加项目组</el-button>
      <el-table :data="projectTeamList">
        <el-table-column align="center" type="index" label="序号" width="150"></el-table-column>
        <el-table-column align="center" property="proName" label="项目组名称" width="200"></el-table-column>
        <el-table-column align="center" property="remark" label="简介"></el-table-column>
        <el-table-column align="center" property="createTime" label="创建时间"></el-table-column>
        <el-table-column align="center" label="操作">
          <template slot-scope="scope">
            <el-button type="text" @click="projectTeamFormDialog(scope.row.id)">编辑</el-button>
            <el-button type="text" @click="deleteProject(scope.row.id)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="projectTotal>0"
        :total="projectTotal"
        :page.sync="projectTeamParam.pageNum"
        :limit.sync="projectTeamParam.pageSize"
        @pagination="getProject"
      />
    </el-dialog>
    <el-dialog width="30%" :before-close="resetProjectTeamForm" :title="projectTitle"
               :visible.sync="projectTeamFormVisible" center>
      <el-form label-position="right" ref="projectTeamForm" :rules="projectTeamRules" label-width="90px"
               :model="projectTeamForm">
        <el-form-item label="项目组名称">
          <el-input style="width: 250px" v-model="projectTeamForm.proName"></el-input>
        </el-form-item>
        <el-form-item label="简介">
          <el-input style="width: 250px" type="textarea" v-model="projectTeamForm.remark"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="resetProjectTeamForm">取 消</el-button>
        <el-button type="primary" @click="submitProjectTeam">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 添加或修改【客户】对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" :close-on-click-modal='false' append-to-body>
      <el-tag style="margin-left: 30px;font-size: 15px;margin-bottom: 10px">企业信息</el-tag>
      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="企业名称" prop="companyName">
              <el-input v-model="form.companyName" placeholder="请输入企业名称" style="width: 300px"/>
            </el-form-item>
          </el-col>

          <el-col :span="10">
            <el-form-item label="签约状态" prop="contract">
              <el-select v-model="form.contract" placeholder="请选择客户属性" style="width: 300px">
                <el-option label="--请选择--" value="" @keyup="handleQuery"></el-option>
                <el-option label="已签约" value="已签约" @keyup="handleQuery"></el-option>
                <el-option label="未签约" value="未签约" @keyup="handleQuery"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="联系人" prop="linkman">
              <el-input v-model="form.linkman" placeholder="请输入联系人" style="width: 300px"/>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="职务" prop="post">
              <el-input v-model="form.post" placeholder="请输入职务" style="width: 300px"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="联系电话" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入联系电话" style="width: 300px"/>
            </el-form-item>
          </el-col>

          <el-col :span="10">
            <el-form-item label="客户属性" prop="property">
              <el-select v-model="form.property" placeholder="请选择客户属性" style="width: 300px">
                <el-option label="--请选择--" value="" @keyup="handleQuery"></el-option>
                <el-option label="新客户" value="新客户" @keyup="handleQuery"></el-option>
                <el-option label="老客户" value="老客户" @keyup="handleQuery"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="客户分类" prop="classification">
              <el-select v-model="form.classification" placeholder="请选择客户分类" style="width: 300px">
                <el-option label="--请选择--" value="" @keyup="handleQuery"></el-option>
                <el-option label="普通客户" value="普通客户" @keyup="handleQuery"></el-option>
                <el-option label="重要客户" value="重要客户" @keyup="handleQuery"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="公司规模" prop="scale">
              <el-select v-model="form.scale" placeholder="请选择客户属性" style="width: 300px">
                <el-option label="--请选择--" value="" @keyup="handleQuery"></el-option>
                <el-option label="0-20" value="0-20" @keyup="handleQuery"></el-option>
                <el-option label="20-99" value="20-99" @keyup="handleQuery"></el-option>
                <el-option label="100-500" value="100-500" @keyup="handleQuery"></el-option>
                <el-option label="500-999" value="500-999" @keyup="handleQuery"></el-option>
                <el-option label="1000-5000" value="1000-5000" @keyup="handleQuery"></el-option>
                <el-option label="10000+" value="10000+" @keyup="handleQuery"></el-option>
              </el-select>
            </el-form-item>
          </el-col>

        </el-row>
        <el-row :gutter="20">
          <el-form-item label="省市区" prop="address" placeholder="请选择省市区" @click="">
            <el-col :span="6">
              <el-cascader
                :options="optionss"
                v-model="selectedAddressOptions"
                @change="handleChange"
                clearable
                filterable>
              </el-cascader>
            </el-col>
            <el-col :span="8">
              <el-input v-model="form.address" placeholder="请输入详细地址" style="width: 300px"/>
            </el-col>
            <el-col :span="6">
              <el-button type="primary" style="float: right" @click="addlm" round>添加联系人</el-button>
            </el-col>
          </el-form-item>
          <hr>
          <el-row :gutter="20" v-for="(it, index) in lm">
            <el-col :span="20" style="padding-left: 60px">
              <div>
                <h3 style="float: left">
                  <el-tag>第{{ index + 1 }}联系人</el-tag>
                </h3>
                <el-button type="primary" style="float: right" size="small" @click.prevent="removeLm(it)">删除</el-button>
                <br>
              </div>
            </el-col>
            <el-col :span="10">
              <el-form-item label="联系人姓名" prop="forLinkName">
                <el-input v-model="it.linkName"/>
              </el-form-item>
              <el-form-item label="联系人电话" prop="forLinkPhone">
                <el-input v-model="it.linkPhone"/>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="联系人职位" prop="forLinkPost">
                <el-input v-model="it.linkPost"/>
              </el-form-item>
            </el-col>

          </el-row>
        </el-row>
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm(form.companyId)">确认</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>

    </el-dialog>

    <el-dialog :title="title" :visible.sync="lmParamsVisibles" width="1000px" :close-on-click-modal='false'
               append-to-body>
      <el-form ref="lmForm" :model="lmParams" :rules="lmParamsRules" label-width="150px">
        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="姓名" prop="linkName">
              <el-input v-model="lmParams.linkName" placeholder="联系人姓名" style="width: 300px"/>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="电话" prop="linkPhone">
              <el-input v-model="lmParams.linkPhone" placeholder="联系人电话" style="width: 300px"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="职位" prop="linkPost">
              <el-input v-model="lmParams.linkPost" placeholder="联系人职位" style="width: 300px"/>
            </el-form-item>
          </el-col>
          <el-col :span="10" style="float: right">
            <el-button type="primary" @click="submitLmParams()">确认</el-button>
            <el-button @click="cancelLm">取 消</el-button>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
    <!-- 企业详情对话框 itoEnterprise-->
    <el-dialog :title="title" :visible.sync="videoVisibles" width="60%" :close-on-click-modal='false' append-to-body
               border>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          @click="handleUpdate2(itoEnterprise.companyId)"
          v-hasPermi="['system:enterprise:edit']"
        >编辑
        </el-button>
      </el-col>
      <el-descriptions class="margin-top" :column="2" border>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              企业名称
            </center>
          </template>
          <center>
            {{ itoEnterprise.companyName }}
          </center>

        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              客户分类
            </center>
          </template>
          <center>
            {{ itoEnterprise.classification }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              客户属性
            </center>
          </template>
          <center>
            {{ itoEnterprise.property }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              公司规模
            </center>
          </template>
          <center>
            {{ itoEnterprise.scale }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              省市区
            </center>
          </template>
          <center>
            {{ itoEnterprise.province }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              详细地址
            </center>
          </template>
          <center>
            {{ itoEnterprise.address }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              联系人
            </center>
          </template>
          <center>{{ itoEnterprise.linkman }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              职务
            </center>

          </template>
          <center>{{ itoEnterprise.post }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              联系电话
            </center>

          </template>
          <center>{{ itoEnterprise.phone }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              是否签约
            </center>
          </template>
          <center>{{ itoEnterprise.contract }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              创建时间
            </center>
          </template>
          <center>{{ parseTime(itoEnterprise.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              负责人
            </center>
          </template>
          <center>{{ itoEnterprise.createName }}</center>
        </el-descriptions-item>
      </el-descriptions>

      <el-descriptions :title="'第'+(index+1)+'联系人'" class="margin-top" :column="3" border
                       v-for="(item,index) in itoEnterprise.lmParams">
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              联系人姓名
            </center>
          </template>
          <center>{{ item.linkName }}</center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              联系人电话
            </center>
          </template>
          <center>{{ item.linkPhone }}</center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              联系人职位
            </center>
          </template>
          <center>{{ item.linkPost }}</center>
        </el-descriptions-item>
      </el-descriptions>

    </el-dialog>

    <!-- 岗位列表弹窗   -->
    <el-dialog :title="title" :visible.sync="videoVisibleStaton" width="90%" :close-on-click-modal='false'
               append-to-body>
      <el-form :model="stationList" ref="queryForm" size="small" :inline="true" v-show="showSearch"
               label-width="68px">
        <el-form-item label="" prop="beginTime">
          <el-date-picker clearable
                          v-model="queryStationParams.beginTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="开始日期">
          </el-date-picker>
        </el-form-item>

        <el-form-item prop="endTimee">
          <el-date-picker clearable
                          v-model="queryStationParams.endTimee"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="结束日期">
          </el-date-picker>
        </el-form-item>

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
        <el-form-item prop="companyName">
          <el-input
            v-model="queryStationParams.all"
            placeholder="请输入搜索内容"
            clearable
            @keyup.enter.native="handleQueryStation"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="max"
                     @click="handleQueryStation(queryStationParams.companyId)">搜索
          </el-button>
          <el-button icon="el-icon-refresh" size="max" @click="resetQueryStation">重置</el-button>
        </el-form-item>
      </el-form>
      <!--      岗位列表-->
      <el-table v-loading="loading" :data="stationList" @selection-change="handleSelectionChange"
                style="width: 100%" max-height="100%">
        <el-table-column type="selection" align="center" width="50"/>
        <el-table-column :show-overflow-tooltip="true" label="岗位名称" align="center" prop="stationName" width="110"/>
        <el-table-column label="岗位等级" align="center" prop="jobGrade" width="100"/>
        <el-table-column label="岗位类型" align="center" prop="stationCategory" width="100"/>
        <el-table-column :show-overflow-tooltip="true" label="企业名称" align="center" prop="companyName" width="200"/>
        <el-table-column :show-overflow-tooltip="true" label="项目组" align="center" prop="proName" width="120"/>
        <el-table-column label="待初筛" align="center" width="60" prop="cou0">
          <template slot-scope="scope">
          <span v-if="scope.row.cou0 == null">
           0
          </span>
            <span v-if="scope.row.cou0 != null">
           {{ scope.row.cou0 }}
          </span>
          </template>


        </el-table-column>
        <el-table-column label="待面试" align="center" width="60" prop="cou1">
          <template slot-scope="scope">
          <span v-if="scope.row.cou1 == null">
           0
          </span>
            <span v-if="scope.row.cou1 != null">
           {{ scope.row.cou1 }}
          </span>
          </template>

        </el-table-column>
        <el-table-column label="待入职" align="center" width="60" prop="cou2">
          <template slot-scope="scope">
          <span v-if="scope.row.cou2 == null">
           0
          </span>
            <span v-if="scope.row.cou2 != null">
           {{ scope.row.cou2 }}
          </span>
          </template>
        </el-table-column>
        <el-table-column label="待录用" align="center" width="60" prop="cou2">
          <template slot-scope="scope">
          <span v-if="scope.row.cou3 == null">
           0
          </span>
            <span v-if="scope.row.cou3 != null">
           {{ scope.row.cou3 }}
          </span>
          </template>
        </el-table-column>
        <el-table-column label="已入职" align="center" width="60" prop="cou3">
          <template slot-scope="scope">
          <span v-if="scope.row.cou6 == null">
           0
          </span>
            <span v-if="scope.row.cou6 != null">
           {{ scope.row.cou6 }}
          </span>
          </template>
        </el-table-column>
        <el-table-column label="薪资范围" align="center" prop="startMoney" width="100">
          <template slot-scope="scope">
            {{ scope.row.startMoney + '~' + scope.row.endMoney }} K
          </template>
        </el-table-column>

        <el-table-column label="岗位定价(K)" align="center" prop="postPricing" width="100">
          <template slot-scope="scope">
            <span v-if="scope.row.postPricing == null">无</span>
            <span v-if="scope.row.postPricing != null">{{ scope.row.postPricing + 'K' }}</span>
          </template>


        </el-table-column>
        <el-table-column label="负责商务" align="center" prop="createdBy" width="120"/>
        <el-table-column label="招聘人数" align="center" prop="need" width="80"/>
        <el-table-column label="招聘截止" align="center" prop="wokeEndTime" width="100">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.wokeEndTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>

        <el-table-column label="岗位创建时间" align="center" prop="createTime" width="130">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width" fixed="right">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-share"
              @click="playVideStation(scope.row.stationId)"
              v-hasPermi="['system:station:query']"
            >详情
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        v-show="total2>0"
        :total="total2"
        :page.sync="queryStationParams.pageNum"
        :limit.sync="queryStationParams.pageSize"
        @pagination="getStationList"
      />
    </el-dialog>

    <!-- 岗位详情对话框 -->
    <el-dialog :title="title" :visible.sync="videoStation" width="90%" :close-on-click-modal='false' append-to-body
               border>
      <el-button
        size="mini"
        type="text"
        style="float:left"
        icon="el-icon-edit"
        @click="handleUpdate1(ItoStation.stationId)"
        v-hasPermi="['system:station:edit']"
      >编辑
      </el-button>

      <el-descriptions class="margin-top" :column="4" border>


        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              岗位名称
            </center>
          </template>
          <center>
            {{ ItoStation.stationName }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              企业名称
            </center>
          </template>
          <center>
            {{ ItoStation.companyName }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              项目组
            </center>
          </template>
          <center>
            {{ ItoStation.proName }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              负责商务
            </center>
          </template>
          <center>{{ ItoStation.createdBy }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              发布日期
            </center>
          </template>
          <center>{{ parseTime(ItoStation.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              学历要求
            </center>
          </template>
          <center>{{ ItoStation.education }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              岗位等级
            </center>
          </template>
          <center>
            {{ ItoStation.jobGrade }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              用工时长
            </center>
          </template>
          <center>{{ ItoStation.endTime }}</center>
        </el-descriptions-item>

        <!--        <span v-if="interview==true">-->
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              工资薪酬(K)
            </center>
          </template>
          <center v-if="ItoStation.interview == 0 ">{{ ItoStation.startMoney }}—{{ ItoStation.endMoney }}K</center>
          <center v-if="ItoStation.interview == 1 ">面议</center>

        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              招聘人数
            </center>
          </template>
          <center>{{ ItoStation.need }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              招聘截止日期
            </center>
          </template>
          <center>{{ parseTime(ItoStation.wokeEndTime, '{y}-{m}-{d}') }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              省市区
            </center>
          </template>
          <center>
            {{ ItoStation.province }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              详细地址
            </center>
          </template>
          <center>
            {{ ItoStation.wokeAddress }}
          </center>
        </el-descriptions-item>


      </el-descriptions>
      <el-descriptions class="margin-top" direction="vertical" :column="2" border>

        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            岗位职责
          </template>
          <span v-html="ItoStation.jobDescription"></span>
        </el-descriptions-item>


        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            岗位要求
          </template>
          <span v-html="ItoStation.remarks"></span>
        </el-descriptions-item>
      </el-descriptions>
      <br>
    </el-dialog>

    <!--入职人员-->
    <el-dialog :title="title" :visible.sync="videoVisibles0" width="90%" :close-on-click-modal='false' append-to-body
               border>
      <span style="padding-left: 20px;font-size: 20px;color:#673ab7;">投递记录</span>&nbsp;&nbsp;
      <el-radio-group v-model="radio1">
        <el-radio-button label="全部" @click.native="aaa('200')"></el-radio-button>
        <el-radio-button label="待初筛" @click.native="aaa(0)"></el-radio-button>
        <el-radio-button label="待面试" @click.native="aaa(1)"></el-radio-button>
        <el-radio-button label="待录用" @click.native="aaa(2)"></el-radio-button>
        <el-radio-button label="待入职" @click.native="aaa(3)"></el-radio-button>
        <el-radio-button label="已入职" @click.native="aaa(6)"></el-radio-button>
      </el-radio-group>
      <el-button type="primary" style="float: right;margin-right: 20px;" @click="downloadAll">批量下载</el-button>
      <br>
      <hr>
      <el-table v-loading="loading" :data="auitvoList"
                ref="multipleTable"
                tooltip-effect="dark"
                style="width: 100%"
                @selection-change="getIds">
        <el-table-column

          align="center"
          type="selection"
          width="55">
        </el-table-column>
        <el-table-column label="状态" align="center" prop="isFirst">
          <template slot-scope="scope">

          <span v-if="scope.row.isFirst == 0">
            <el-tag type="info">待初筛</el-tag>
          </span>
            <span v-if="scope.row.isFirst == 1">
             <el-tag type="primary">待面试</el-tag>
          </span>
            <span v-if="scope.row.isFirst == 2">
             <el-tag type="primary">待录用</el-tag>
          </span>
            <span v-if="scope.row.isFirst == 3">
             <el-tag type="warning">待入职</el-tag>
          </span>
            <span v-if="scope.row.isFirst == 6">
             <el-tag type="danger">已入职</el-tag>
          </span>
          </template>

        </el-table-column>
        <el-table-column label="创建时间" align="center" prop="createTime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="负责人" align="center" prop="createName"/>
        <el-table-column label="简历名称" align="center" prop="resumeName"/>
        <el-table-column label="简历电话" align="center" prop="phone"/>
        <el-table-column label="岗位名称" align="center" prop="stationName"/>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              @click="download(scope.row.resumeId)"
              v-hasPermi="['system:station:edit']"
            >下载简历
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        v-show="total1>0"
        :total="total1"
        :page.sync="queryParam.pageNum"
        :limit.sync="queryParam.pageSize"
        @pagination="aaa()"
      />
    </el-dialog>
    <!-- 添加或修改【岗位】对话框 -->
    <el-dialog :title="title" :visible.sync="openStation" width="70%" :close-on-click-modal='false' append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="招聘企业" prop="companyId">
              <template>
                <el-select v-model="value" filterable placeholder="请选择">
                  <el-option
                    v-for="item in options"
                    :key="item.companyId"
                    :label="item.companyName"
                    :value="item.companyId">
                  </el-option>
                </el-select>
              </template>
            </el-form-item>

          </el-col>
          <el-col :span="12">
            <el-form-item label="岗位名称" prop="stationName">
              <el-input v-model="form.stationName" placeholder="请输入岗位名称"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="学历要求" prop="education">
              <el-select v-model="form.education" placeholder="请选择学历" style="width: 100%">
                <el-option label="请选择" value=""></el-option>
                <el-option label="不限" value=""></el-option>
                <el-option label="专科" value="大专"></el-option>
                <el-option label="本科" value="本科"></el-option>
                <el-option label="硕士" value="硕士"></el-option>
                <el-option label="博士" value="博士"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工作经验" prop="jobGrade">
              <template>
                <el-radio-group v-model="form.jobGrade">
                  <el-radio-button label="初级"></el-radio-button>
                  <el-radio-button label="中级"></el-radio-button>
                  <el-radio-button label="高级"></el-radio-button>
                </el-radio-group>
              </template>
            </el-form-item>

          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="招聘人数" prop="need">
              <el-input-number v-model="form.need" :min="1" :max="999" label="请输入需招人数"></el-input-number>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="用工时长(月)" prop="endTime">
              <el-input-number v-model="form.endTime" :min="1" :max="120" label="请输入需招人数"></el-input-number>
            </el-form-item>
          </el-col>

        </el-row>


        <el-row :gutter="24">
          <el-col :span="12">


            <!--            <span v-if="interview">-->

            <!--            </span>-->
            <!--            <span v-else>-->
            <el-form-item label="最低工资(K)" prop="startMoney">
              <el-input v-model="form.startMoney" placeholder="请输入最低工资(K)" style="width: 150px"/>
              —
              <el-input v-model="form.endMoney" placeholder="请输入最高工资(K)" style="width: 160px"/>&nbsp;&nbsp;
              <el-checkbox v-model="checked">面议</el-checkbox>
            </el-form-item>
            <!--            </span>-->
            <!--            @click.native="sss()"-->
          </el-col>


          <el-col :span="12">
            <el-form-item label="招聘截止时间" prop="wokeEndTime">
              <el-date-picker clearable
                              style="width: 100%"
                              v-model="form.wokeEndTime"
                              type="date"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择招聘截止时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">

            <el-form-item label="省 市 区" prop="province" placeholder="请选择省市区" style="width: 780px;">
              <el-col :span="8">

                <el-cascader
                  size="large"
                  :options="optionss"
                  v-model="selectedAddressOptions"
                  @change="handleChange">
                </el-cascader>

              </el-col>
              <el-col :span="4">
                <el-input v-model="form.wokeAddress" placeholder="请输入详细地址" style="width: 300px"/>
              </el-col>
            </el-form-item>


          </el-col>
        </el-row>


        <el-form-item label="岗位职责" prop="jobDescription">
          <el-input v-model="form.jobDescription" type="textarea" placeholder="请输入岗位职责" autosize/>
        </el-form-item>

        <el-form-item label="岗位要求" prop="remarks">
          <el-input v-model="form.remarks" type="textarea" placeholder="请输入" autosize/>
        </el-form-item>
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormStation">确 定</el-button>
        <el-button @click="cancelStation">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import {regionData, CodeToText, TextToCode} from 'element-china-area-data'
  import {
    listEnterprise,
    getEnterprise,
    delEnterprise,
    addEnterprise,
    updateEnterprise,
    getEnte,
    listStation,
    getStation, getStationList, resumeList,
    AddLinkMan,
    getProjectTeamList,
    addProjectTeam,
    getProjectTeamForm,
    updateProjectTeam,
    deleteProjectTeam
  } from "@/api/system/enterprise";
  import {listAuitvo} from "@/api/system/auitvo";
  import {addAuit, getResume, listResume} from "@/api/system/resume";
  import {addStation, eliminate, getStationResume, updateStation} from "@/api/system/station";
  import log from "@/views/monitor/job/log";

  export default {
    name: "Enterprise",
    data() {
      return {
        projectTeamVisible: false,
        projectTeamFormVisible: false,
        projectTeamForm: {},
        projectTeamParam: {
          pageNum: 1,
          pageSize: 10,
          companyId: undefined
        },
        projectTeamList: [],
        projectTotal: 0,
        projectTeamRules: {
          proName: [
            {required: true, message: '请输入项目组名称', trigger: 'blur'}
          ]
        },
        // {linkName: '刘备', linkPhone: '13334343434', linkPost: '开发工程师'}
        lm: [],
        lmParams: {
          linkName: null, linkPhone: null, linkPost: null
        },
        value: '',
        options: '',
        radio1: '全部',
        isFirst: '',
        checked: false,
        auitvoList: [],
        resIds: [],
        sId: null,
        //省市区
        optionss: regionData,
        selectedAddressOptions: [],

        xxx: "200",


        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        total1: 0,
        total2: 0,
        // 【请填写功能名称】表格数据
        enterpriseList: [],
        // 岗位表格数据
        stationList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        linkmanSync: false,
        open: false,
        openStation: false,
        videoVisibles: false,
        videoVisibleStaton: false,
        videoStation: false,
        videoVisibleResume: false,
        videoVisibleB: false,
        videoVisibles0: false,
        lmParamsVisibles: false,

// 岗位查询参数
        queryStationParams: {
          pageNum: 1,
          pageSize: 10,
          companyId: null,

          stationName: null,
          stationCategory: null,
          postPricing: null,
          jobGrade: null,
          experience: null,
          jobDescription: null,
          education: null,
          recruited: null,
          need: null,
          companyName: null,
          province: null,
          wokeAddress: null,
          companyPhone: null,
          companyMailbox: null,
          endTime: null,
          salaryRange: null,
          remarks: null,
          companyWelfare: null,
          createTime: null,
          createdBy: null,
          updateTime: null,
          updatedBy: null,
          wokeEndTime: null,
          startMoney: null,
          endMoney: null,
          beginTime: null,
          endTimee: null,
          status: null,
          cou0: null,
          cou1: null,
          cou2: null,
          cou3: null,
          all: null,
          isDelete: null
        },
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          companyName: null,
          classification: null,
          property: null,
          province: null,
          address: null,
          scale: null,
          linkman: null,
          post: null,
          phone: null,
          contract: null,
          status: null,
          isDelete: null,
          protectStatus: '0',
          all: null
        },
        //详情查询
        itoEnterprise: {
          companyId: null,
          companyName: null,
          classification: null,
          property: null,
          province: null,
          address: null,
          scale: null,
          linkman: null,
          post: null,
          phone: null,
          contract: null,
          createBy: null,
          createName: null,
          createTime: null,
          updateBy: null,
          updateName: null,
          updateTime: null,
          status: null,
          isDelete: null,
          protectStatus: null,
        },

        //查询推送表参数
        queryParamsAuitvo: {
          pageNum: 1,
          pageSize: 10,
          isFirst: 1,
          stationSecond: null,
          resumeName: null,
          phone: null,
          companyName: null,
          stationName: null,
          companyPhone: null,
          companyMailbox: null,
          query: null,
          beginTime: null,
          endTime: null,
          imgPath: null
        }, //查询推送表参数
        queryParam: {
          pageNum: 1,
          pageSize: 10,
          companyId: null,
          isFirst: null
        },


        // 岗位详情
        ItoStation: {
          stationId: null,
          stationName: null,
          stationCategory: null,
          jobGrade: null,
          experience: null,
          jobDescription: null,
          education: null,
          recruited: null,
          need: null,
          companyName: null,
          province: null,
          wokeAddress: null,
          companyPhone: null,
          companyMailbox: null,
          endTime: null,
          salaryRange: null,
          remarks: null,
          companyWelfare: null,
          createTime: null,
          createdBy: null,
          updateTime: null,
          updatedBy: null,
          wokeEndTime: null,
          startMoney: null,
          endMoney: null,
          status: null,
          interview: null,
          isDelete: null
        },
        // 查询简历参数
        queryResumeParams: {
          pageNum: 1,
          pageSize: 5,
          resumeId: null,
          resumeName: null,
          sex: null,
          age: null,
          imgPath: null,
          education: null,
          phone: null,
          workyear: null,
          mailbox: null,
          expectStation: null,
          expectWage: null,
          workplace: null,
          professionalSkill: null,
          workeUndergo: null,
          projectUndergo: null,
          educationalBackground: null,
          selfEvaluate: null,
          status: null,
          isDelete: 0,
          lowAge: undefined,
          tallAge: undefined,
          lowWage: undefined,
          tallWage: undefined,
          lowWorkyear: undefined,
          tallWorkyear: undefined
        },

        // 查询简历参数2
        itoResume: {
          resumeId: null,
          resumeName: null,
          sex: null,
          age: null,
          imgPath: null,
          education: null,
          phone: null,
          workyear: null,
          mailbox: null,
          expectStation: null,
          expectWage: null,
          workplace: null,
          professionalSkill: null,
          workeUndergo: null,
          projectUndergo: null,
          educationalBackground: null,
          selfEvaluate: null,
          status: null,
          isDelete: 0,

        },

        linkmanInfo: {},
        /*企业id*/
        companyIdd: null,
        // 表单参数
        form: {lmParams: []},
        middle: {},
        // 表单校验

        lmParamsRules: {
          linkName: [
            {required: true, message: '联系人姓名不能为空', trigger: 'blur'}
          ],
          linkPhone: [
            {required: true, message: '电话不能为空', trigger: 'blur'},
            {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
          ],
          linkPost: [
            {required: true, message: '联系人职位不能为空', trigger: 'blur'}
          ]
        },
        rules: {
          companyName: [
            {required: true, message: '公司名称不能为空', trigger: 'blur'}
          ],
          classification: [
            {required: true, message: '客户分类不能为空', trigger: 'change'}
          ],
          property: [
            {required: true, message: '客户属性不能为空', trigger: 'change'}
          ],
          province: [
            {required: true, message: '省市区不能为空', trigger: 'change'}
          ],
          address: [
            {required: true, message: '公司详细地址不能为空', trigger: 'blur'}
          ],
          scale: [
            {required: true, message: '公司规模不能为空', trigger: 'change'}
          ],
          linkman: [
            {required: true, message: '联系人不能为空', trigger: 'blur'}
          ],

          post: [
            {required: true, message: '职务不能为空', trigger: 'change'}
          ],
          phone: [
            {required: true, message: '电话不能为空', trigger: 'blur'},
            {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
          ],
          contract: [
            {required: true, message: '是否签约不能为空', trigger: 'change'}
          ],
        },
        projectTitle: ''
      };
    },
    created() {
      this.getList();
    },
    methods: {
      deleteProject(id) {
        deleteProjectTeam(id).then(res => {
          this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            if (res.msg === "已删除") {
              this.getProject()
              this.$message({
                message: res.msg,
                type: 'success'
              });
            } else if (res.msg === "改项目组下存在岗位,不允许删除") {
              this.$message({
                message: res.msg,
                type: 'warning'
              });
            }
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消删除'
            });
          });
        })
      },
      projectDialog(companyId) {
        this.projectTeamVisible = true
        this.projectTeamForm.companyId = companyId
        this.getProject()
      },
      getProject() {
        this.projectTeamParam.companyId = this.projectTeamForm.companyId
        getProjectTeamList(this.projectTeamParam).then(res => {
          this.projectTeamList = res.rows
          this.projectTotal = res.total
        })
      },
      projectTeamFormDialog(id) {
        if (id === undefined) {
          this.projectTitle = '添加项目组'
          this.projectTeamFormVisible = true;
        } else {
          this.projectTitle = '编辑项目组'
          getProjectTeamForm(id).then(res => {
            this.projectTeamForm = res.data
            this.projectTeamFormVisible = true;
          })
        }
      },
      resetProject() {
        this.projectTeamForm = {}
        this.projectTeamList = []
        this.projectTeamParam = {
          pageNum: 1,
          pageSize: 10,
          companyId: undefined
        }
        this.projectTotal = 0
        this.projectTeamVisible = false
      },
      resetProjectTeamForm() {
        this.projectTeamForm.proName = undefined
        this.projectTeamForm.remark = undefined
        this.projectTeamForm.createTime = undefined
        this.projectTeamForm.id = undefined
        this.projectTeamFormVisible = false;
      },
      submitProjectTeam() {
        this.$refs["projectTeamForm"].validate(valid => {
          if (valid) {
            if (this.projectTeamForm.id !== undefined) {
              updateProjectTeam(this.projectTeamForm).then(res => {
                this.getProject()
                this.resetProjectTeamForm()
                this.$message({
                  message: "修改成功",
                  type: 'success'
                });
              })
            } else {
              addProjectTeam(this.projectTeamForm).then(res => {
                this.getProject()
                this.resetProjectTeamForm()
                this.$message({
                  message: "添加成功",
                  type: 'success'
                });
              })
            }
          }
        })

      },
      // 更多操作触发
      handleCommand(command, row) {
        switch (command) {
          case "handleAuthStation":
            this.playVideo(row.companyId);
            break;
          case "handleAuthEmp":
            this.updateEnt(row.companyId);
            break;
          case "handleAuthProject":
            this.projectDialog(row.companyId);
          default:
            break;
        }
      },
      removeLm(item) {
        var index = this.lm.indexOf(item)
        if (index !== -1) {
          this.lm.splice(index, 1)
        }
      },
      cancelLm() {
        this.lmParams = {}
        this.resetForm("lmForm");
        this.lmParamsVisibles = false;
      },
      submitLmParams() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.lmParams != null) {
              this.lm.push(this.lmParams)
            }
            this.lmParamsVisibles = false;
            this.videoVisibles = false;
            this.lmParams = {}
          }
        })

      },
      chageLm(item) {
        console.log(item)
      },
      addlm() {
        this.lmParamsVisibles = true;
      },

      linkmanMit() {
        AddLinkMan(this.linkmanInfo).then(res => {
          console.log(res)
        })
      },
      insertLinkman() {
        this.linkmanSync = true
      },
      linkReset() {
        this.linkmanSync = false;
        this.linkmanInfo = {}
      },
      //省市区
      handleChangeS(value) {
        //我们选择地址后，selectedAddressOptions 会保存对应的区域码，
        //例如北京的区域码为'110000'
        //我们要取出区域码对应的汉字，就需要用CodeToText(区域码)进行输出
        var name = ''
        this.selectedAddressOptions.map(item => name += CodeToText[item] + '/')
        this.form.province = name;//更新表单的数据，以便保存更新
      },
      handleChange(value) {
        //我们选择地址后，selectedAddressOptions 会保存对应的区域码，
        //例如北京的区域码为'110000'
        //我们要取出区域码对应的汉字，就需要用CodeToText(区域码)进行输出
        var name = ''
        this.selectedAddressOptions.map(item => name += CodeToText[item] + '/')
        this.form.province = name;//更新表单的数据，以便保存更新
      },
      /** 根据企业id查询名下岗位列表 */
      getStationList(companyId) {
        this.queryStationParams.companyId = companyId
        getStationList(this.queryStationParams).then(response => {
          console.log(response)
          this.stationList = response.rows;
          this.total2 = response.total;
        });
        this.loading = false;
      },

      /** 查询【客户】列表 */
      getList() {
        this.loading = true;
        listEnterprise(this.queryParams).then(response => {
          this.enterpriseList = response.rows;
          this.total = response.total;
        });
        this.loading = false;
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.selectedAddressOptions = []
        this.form = {
          companyId: null,
          companyName: null,
          classification: null,
          property: null,
          address: null,
          scale: null,
          linkman: null,
          post: null,
          phone: null,
          contract: null,
          createBy: null,
          createName: null,
          createTime: null,
          updateBy: null,
          updateName: null,
          updateTime: null,
          status: null,
          isDelete: null,
          all: null,
          lmParams: []
        };
        this.lm = [];
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 搜索按钮操作 */
      handleQueryStation(companyId) {
        this.queryStationParams.pageNum = 1;
        this.getStationList(companyId);
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.queryParams = {
          pageNum: 1,
          pageSize: 10,
          companyName: null,
          classification: null,
          property: null,
          province: null,
          address: null,
          scale: null,
          linkman: null,
          post: null,
          phone: null,
          contract: null,
          status: null,
          isDelete: null,
          protectStatus: '0',
          all: null
        }
        this.resetForm("queryForm");
        this.handleQuery();
      },
      /** 重置按钮操作 */
      resetQueryStation(companyId) {
        this.queryStationParams = {};
        companyId = this.companyIdd
        this.resetForm("queryForm");
        this.handleQueryStation(companyId);
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.companyId)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加企业";
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const companyId = row.companyId || this.ids
        getEnterprise(companyId).then(response => {
          this.form = response.data;
          this.open = true;
          var addressStr = new Array(); //定义一数组
          addressStr = (this.form.province).split("/"); //字符分割
          this.selectedAddressOptions = TextToCode[addressStr[0]][addressStr[1]][addressStr[2]].code;
          this.title = "修改企业";
        });
      }, handleUpdate2(companyId) {
        // this.reset();
        getEnterprise(companyId).then(response => {
          this.form = response.data;
          this.open = true;
          var addressStr = new Array(); //定义一数组
          addressStr = (this.form.province).split("/"); //字符分割
          this.selectedAddressOptions = TextToCode[addressStr[0]][addressStr[1]][addressStr[2]].code;
          this.title = "修改企业";
        });
      },
      /** 客户提交按钮 */
      submitForm(companyId) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.companyId != null) {
              this.form.lmParams = this.lm
              updateEnterprise(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.videoVisibles = false;
                this.getList();
              });
            } else {
              this.form.lmParams = this.lm
              addEnterprise(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.lm = [];
                this.videoVisibles = false;
                this.getList();
              });
            }
          }
        });
      },


      /** 删除按钮操作 */
      handleDelete(row) {
        const companyIds = row.companyId || this.ids;
        this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + companyIds + '"的数据项？').then(function () {
          return delEnterprise(companyIds);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {
        });
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('system/enterprise/export', {
          ...this.queryParams
        }, `enterprise_${new Date().getTime()}.xlsx`)
      },

      /** 岗位详情按钮操作 */
      //点击按钮时,触发弹出效果
      playVideStation(stationId) {
        var isFirst = '200';
        this.sId = stationId;
        //触发点击时,让其显示
        getStationResume(stationId, isFirst).then(response => {
          this.auitvoList = response.data;
        });
        getStation(stationId).then(response => {
          this.ItoStation = response.data;
          this.videoStation = true
          this.title = "岗位详情";
        });
      },

      /** 客户列表后的岗位按钮操作 */
      playVideo(companyId) {
        //触发点击时,让其显示
        this.companyIdd = companyId
        this.queryStationParams.companyId = companyId
        this.videoVisibleStaton = true
        this.title = "岗位列表"
        this.getStationList(companyId)
      },

      /** 客户详情按钮操作 */
      //点击按钮时,触发弹出效果
      getEnte(companyId) {
        getEnte(companyId).then(response => {
          this.itoEnterprise = response.data;
          this.lm = response.data.lmParams
          console.log(this.lm)
          //触发点击时,让其显示
          this.videoVisibles = true
          this.title = "企业详情"
        });
      },


      /*文件下载*/
      download(resumeId) {
        this.$download.zip(resumeId)
      },
      downloadAll() {
        this.$download.zip(this.resIds)
      },
      getIds(val) {
        this.resIds = val.map(item => item.resumeId);
      },

      /** 岗位详情页修改按钮操作 */
      handleUpdate1(stationId) {
        this.reset();
        this.showitem = false
        //const stationId = this.sId
        getStation(stationId).then(response => {
          if (response.data.interview == '1') {
            this.checked = true;
          }
          if (response.data.interview == '0') {
            this.checked = false;
          }
          this.form = response.data;
          this.openStation = true;
          var addressStr = new Array(); //定义一数组
          addressStr = (this.form.province).split("/"); //字符分割
          this.selectedAddressOptions = TextToCode[addressStr[0]][addressStr[1]][addressStr[2]].code;
          this.title = "修改岗位信息";
          this.getListStation();
        });
      },

      /** 查询 简历 列表 */
      getResumeList() {
        this.loading = true;
        listResume(this.queryResumeParams).then(response => {
          this.resumeList = response.rows;
          this.total = response.total;
        });
        this.loading = false;
      },
      /** 搜索按钮操作 */
      handleQueryResume() {
        this.queryParams.pageNum = 1;
        this.getResumeList();
      },
      /** 重置简历按钮操作 */
      resetQueryResume() {
        this.queryResumeParams = {}
        this.resetForm("queryForm");
        this.handleQueryResume();
      },

      /** 简历详情按钮操作 */
      //点击按钮时,触发弹出效果
      playVideoB(resumeId) {
        getResume(resumeId).then(response => {
          this.itoResume = response.data;
          this.videoVisibleB = true
          this.title = "简历详情"
        });
      },

      /** 简历推送添加 */
      addAuits(resumeId) {
        var stationId = this.stationId
        addAuit(resumeId, stationId).then(response => {
          this.$modal.msgSuccess("推送成功");
          this.open = false;
          this.getResumeList()
          this.videoVisible = true
        });
      },

      /** 客户释放修改 */
      updateEnt(companyId) {
        this.queryParams.companyId = companyId
        this.queryParams.protectStatus = '1'
        this.queryParams.userId = 0
        this.$confirm('是否确认释放该客户?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          updateEnterprise(this.queryParams).then(response => {
            this.$message({
              type: 'success',
              message: '释放成功'
            });
            this.queryParams.protectStatus = '0'
            this.getList()
          });

        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          });
        });
      },
      /** 岗位提交按钮 */
      submitFormStation() {
        this.form.companyId = this.value
        if (this.checked == false) {
          this.form.interview = '0'
        }
        if (this.checked == true) {
          this.form.interview = '1'
        }
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.stationId != null) {
              updateStation(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.openStation = false;
                this.getStationList(this.companyIdd);
              });
            } else {
              addStation(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.openStation = false;
                this.getStationList(this.companyIdd);
              });
            }
          }
        });
      },
      // 取消按钮
      cancelStation() {
        this.openStation = false;
        this.reset();
      },

      /** 岗位淘汰按钮操作 */
      handleeliminate(stationId) {
        const stationIds = stationId || this.ids;
        this.$modal.confirm('是否确认淘汰该岗位？').then(function () {
          return eliminate(stationIds);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("淘汰成功");
        }).catch(() => {
        });
      },
      /** 查询推送表列表 */
      getListAuitvo(companyId) {
        this.videoVisibles0 = true;
        this.queryParam.companyId = companyId
        this.queryParam.isFirst = this.xxx;
        this.radio1 = '全部';
        resumeList(this.queryParam).then(response => {
          this.auitvoList = response.rows;
          this.total1 = response.total;

        });
        this.loading = false;
      },

      aaa(xxx) {
        if (xxx != null) {
          this.queryParam.isFirst = xxx
        }

        resumeList(this.queryParam).then(response => {
          this.auitvoList = response.rows;
          this.total1 = response.total;
        });
      },

    }
  };
</script>
